Skip to content

fix(cli): Ensure home directory exists when writing contexts#3069

Open
pauliyobo wants to merge 2 commits intoapache:masterfrom
pauliyobo:fix/issue-3030
Open

fix(cli): Ensure home directory exists when writing contexts#3069
pauliyobo wants to merge 2 commits intoapache:masterfrom
pauliyobo:fix/issue-3030

Conversation

@pauliyobo
Copy link
Copy Markdown

Which issue does this PR close?

Closes #3030

Rationale

What changed?

When write_contexts() or write_active_context() are called, they directly attempt to write the file without ensuring that the iggy home directory exists. This causes issues like #3030
To fix this, ensure_iggy_home() is called in both methods prior to file creation.

Local Execution

Passed, and precommit ran

PS: I had to add writeable to the typos toml configuration since it would kep being flagged. Not sure if this could cause issues when a genuine spelling mistake happens.

@pauliyobo
Copy link
Copy Markdown
Author

Hello
@atharvalade thanks a lot, fixed the duplicate entry.

Copy link
Copy Markdown
Contributor

@atharvalade atharvalade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing it! lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(cli): context use can fail on fresh system when ~/.iggy/ directory does not exist

2 participants